impersonate

inline suspend fun <T : AuthRecord> impersonate(collection: String, id: String, duration: <Error class: unknown class>? = null, expandRelations: ExpandRelations = ExpandRelations(), fields: ShowFields = ShowFields()): AuthResponse<T>

Impersonate allows you to authenticate as a different user by generating a non-refreshable auth token.

Only superusers can perform this action.

Parameters

collection

the ID or name of the auth collection

id

the ID of the user you with to impersonate

duration

Optional custom JWT duration for the exp claim (in seconds). If not set or 0, it fallbacks to the default collection auth token duration option.